<template>
  <div class="editCont">
    <div class="edt2" @click="back">
      <img
        style="width: 29px; height: 25px; opacity: 0.5; cursor: pointer"
        src="../../assets/back.png"
      />
      <span>返回</span>
    </div>
    <div class="edt1">
      <el-button type="primary" @click="preview">查看认证证书</el-button>
       <!-- <img style="width: 100px; height: 100px" :src="imgUrl" title="点击查看大图" @dblclick="preview"></img> -->
      <el-image-viewer
        v-if="detailVisible"
        :url-list="imgList"
        :on-close="closeFunc"
      />
      <el-button type="primary" plain @click="editba">编辑</el-button>
    </div>
    <div class="hx"></div>
    <div class="contss">
      <div>
        <span class="jx"><span style="margin-left: 10px">基本信息</span></span>
      </div>
      <div class="fmor">
        <el-form
          :model="infos"
          ref="infos"
          size="mini"
          label-width="150px"
          label-position="right"
          :rules="rules"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="企业名称:">
                {{ infos.name }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="统一社会信用代码:">
                {{ infos.creditCode }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="中证码:">
                {{ infos.middleSignCode }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="所属地区:">
                {{ infos.area }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="类型:">
                {{ infos.type }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="企业所有制:">
                {{ infos.enterpriseOwnership }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="注册资本:">
                {{ infos.registerCapital }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="营业收入:">
                {{ infos.businessIncome }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="行业分类:">
                {{ infos.industryClassification }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="资产总数:">
                {{ infos.totalAssets }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="从业人数:">
                {{ infos.employeeNumber }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="规模:">
                {{ infos.scale }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="是否涉及农业:">
                {{ infos.isInvolveAgriculture }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="是否绿色农业:">
                {{ infos.isGreenEnterprise }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="是否科技企业:">
                {{ infos.isTechnologyEnterprise }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="是否民营企业:">
                {{ infos.isNongovernmentalEnterpise }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="营业开始时:">
                {{ infos.businessStartTime }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="营业结束时间:">
                {{ infos.businessEndTime }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="经营范围:">
                {{ infos.businessScope }}
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="xtrz"></div>
        <div>
          <span class="jx2"><span style="margin-left: 10px">经办人</span></span>
        </div>
        <el-form
          :model="infos"
          ref="infos"
          size="mini"
          label-width="150px"
          label-position="right"
          :rules="rules"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="姓名:">
                {{ infos.agentName }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="居民身份证号码:">
                {{ infos.agentIdentificationNumber }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="联系电话:">
                {{ infos.agentPhone }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="电子邮箱:">
                {{ infos.agentEmail }}
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="xtrz"></div>
        <div>
          <span class="jx2"
            ><span style="margin-left: 10px">法人信息</span></span
          >
        </div>
        <el-form
          :model="infos"
          ref="infos"
          size="mini"
          label-width="150px"
          label-position="right"
          :rules="rules"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="姓名:">
                {{ infos.corporationName }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="国籍:">
                {{ infos.corporationNationality }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="证件类型:">
                {{ infos.credentialsType }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="证件号码:">
                {{ infos.credentialsNumber }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="证件签发日:">
                {{ infos.credentialsSignTime }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="证件到期日:">
                {{ infos.credentialsExpireTime }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="证件签发城市:">
                {{ infos.credentialsSignCity }}
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import { editWorks, getUploadInfo, makeAuthPdf } from "@/api/leagues/app";

export default {
  name: "",
  components: {
    ElImageViewer,
  },
  data() {
    return {
      detailVisible: false,
      billInfo: {},
      transInfo: {},
      formrenz: {},
      infos: {},
      imgUrl:'' ,
      imgList:[],
      }  
  },
  //方法集合
  created() {
    // this.getEdit();
    this.getUploadInfos();
  },
  methods: {
    getEdit() {
      console.log(this.$route.query, "this.$route.query");
      let editRowId = this.$route.query.editRowId;
      editWorks(editRowId)
        .then((response) => {
          console.log(response.data.data.billInfo, "response");
          this.billInfo = response.data.data.billInfo;
          this.transInfo = response.data.data.transInfo;
        })
        .catch(() => {});
    },

    getUploadInfos() {
      var that = this;
      getUploadInfo()
        .then((data) => {
          this.infos = data.data.data;
          that.$message.success(data.data.msg);
        })
        .catch((error) => {
          console.log(error);
        });
    },
    back() {
      this.$router.go(-1);
    },
    //照片
    preview() {
      var that = this;
      makeAuthPdf()
        .then((res) => {
          this.detailVisible=true;
          this.imgUrl =  window.URL.createObjectURL(res.data);
           console.log( this.imgUrl,' this.imgUrl')
          this.imgList[0]=this.imgUrl;
          console.log( this.imgList[0],' this.imgList')
        })
        .catch((error) => {
          console.log(error);
        });
    },

    // preview() {
    //   this.makeAuthPdfs();
    //   // this.detailVisible = true;
    //   // this.imgList = "";
    //   // this.imgList.push(row.imgUrl);
    // },
    closeFunc() {
      this.detailVisible = false;
    },
    editba() {
      this.$router.push({ name: "editUser" });
    },
  },
};
</script>
<style  scoped>
.edt2 {
  float: left;
  height: 24px;
  font-size: 25px;
  font-weight: bold;
  color: #051232;
  line-height: 54px;
  margin-left: 10px;
}
.edt1 {
  height: 24px;
  font-size: 25px;
  font-weight: bold;
  color: #051232;
  line-height: 54px;
  float: right;
  margin-right: 11px;
}
.jx {
  width: 2px;
  height: 20px;
  font-size: 18px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #051232;
  line-height: 100px;
  text-indent: 20px;
  border-left: 3px solid #0075ff;
  margin-left: 40px;
}
.jx2 {
  width: 2px;
  height: 20px;
  font-size: 18px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #051232;
  line-height: 100px;
  text-indent: 20px;
  border-left: 3px solid #0075ff;
  margin-left: -47px;
}
.pj {
  height: 84px;
  background: rgba(255, 255, 255, 0);
  box-shadow: 0px 1px 0px 0px #e6e6e6;
  display: flex;
  margin-left: 94px;
}
.fmor {
  position: relative;
  margin-left: 93px;
}
.editCont {
  width: 1200px;
  /* height: 890px; */
  background: #ffffff;
  box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.06);
  border-radius: 6px 6px 10px 10px;
  margin: 0 auto;
  position: relative;
  top: 50%;
}
.hx {
  width: 1200px;
  height: 54px;
  background: rgba(255, 255, 255, 0);
  box-shadow: 0px 1px 0px 0px #e6e6e6;
}
.hx2 {
  width: 1200px;
  height: 54px;
  background: rgba(255, 255, 255, 0);
  box-shadow: 0px 1px 0px 0px #e6e6e6;
  margin-top: 181px;
}
.lzp {
  margin-left: 10px;
}
.sx {
  width: 2px;
  height: 20px;
  background: #0075ff;
}
.sxzt {
  height: 17px;
  font-size: 18px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #051232;
  line-height: 10px;
  margin-left: 10px;
  margin-top: 5px;
}
.tag {
  width: 63px;
  height: 26px;
  border: 2px solid #15be6b;
  position: relative;
  background-color: #15be6b;
  margin-left: 119px;
  margin-top: -52px;
}
.tag:before,
.tag:after {
  content: "";
  display: block;
  border-width: 7px;
  position: absolute;
  bottom: -16px;
  left: -1px;
  border-style: solid dashed dashed;
  border-color: #15be6b transparent transparent;
  font-size: 0;
  line-height: 0;
}
/* .tag:after {
  bottom: -33px;
  border-color: #fff transparent transparent;
} */
.tag span {
  width: 35px;
  height: 12px;
  font-size: 12px;
  font-weight: 400;
  color: #ffffff;
  line-height: 23px;
  padding-left: 7px;
}
.lfwz {
  height: 14px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #586279;
  line-height: 36px;
  margin-top: 57px;
  margin-left: 85px;
}
.lfwzsp {
  display: inline-block;
  width: 80px;
  text-align: right;
}

.rgftu {
  float: right;
  display: inline-flex;
  margin-right: 225px;
  margin-top: -19px;
}
.jywz {
  height: 13px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #586279;
  line-height: 56px;
  margin-left: 70px;
}
.jycts {
  display: flex;
  margin-top: 13px;
}
</style>
